<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>简单的轮播</title>
	</head>
	<body>
<div class="side" id = "lunbo">    
    <ul>    
        <li><img src="../public/imgs/1.jpg"></li>    
        <li><img src="../public/imgs/2.jpg"></li>    
        <li><img src="../public/imgs/3.jpg"></li>   
    </ul>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可设置轮播时间</p>
</div>

	</body>
<script type="text/javascript">
	var li=document.getElementById('lunbo').getElementsByTagName("li");  
    var num=0;  
    var len=li.length;  
	var i;
	li[0].style.display="inline-block";
    for (i=1;i<len;i++) {
    	li[i].style.display="none";
    }
    setInterval(function(){  
        li[num].style.display="none";  
        num=++num==len?0:num;  
        li[num].style.display="inline-block";  
  
	},1000);//切换时间
</script>
</html>
